package P3_4;

public class Pair {
//class variables
	public double p1;
	public double p2;
//constructor
	public Pair(){
		this(0,0);
	}
	public Pair(double val1,double val2){
		p1 = val1;
		p2 = val2;
	}
//mehtods
	public double getSum(){
		double sum = p1+p2;
		return sum;
	}
	public double getSum(double sum1, double sum2){
		double sum = sum1+sum2;
		return sum;
	}
	public double getDiff(){
		double diff = p1-p2;
		return diff;
	}
	public double getProd(){
		double prod = p1*p2;
		return prod;
	}
	public double getAvr(){
		double avr=(p1+p2)/2;
		return avr;
	}
	public double getDist(){
		double dist=Math.abs(p1-p2);
		return dist;
	}
	public double getMax(){
		double max=Math.max(p1, p2);
		return max;
	}
	public double getMin(){
		double min=Math.min(p1, p2);
		return min;
	}
}	

